package com.crm.dao;

import org.hibernate.Criteria;
import org.hibernate.criterion.Restrictions;

import com.crm.dao.core.BaseDao;
import com.crm.pojo.Org;

public class OrgDao extends BaseDao<Org, String> {

	public Org findByUserIdAndOrgNameId(String userid, String orgnameid) {
		Criteria cri = getSession().createCriteria(Org.class);
		cri.add(Restrictions.eq("user.id", userid));
		cri.add(Restrictions.eq("orgName.id", orgnameid));
		return (Org) cri.uniqueResult();
	}
	
}
